package com.sxy.dto;

import com.sxy.entity.Success;
import com.sxy.enums.SeckillStatEnum;

/**  
* @ClassName: SeckillExecution  
* @Description: TODO(封装秒杀执行后的结果)  
* @author xy
* @date 2017年12月7日  
*    
*/ 
public class SeckillExecution {

	private long seckillId;
	//秒杀执行结果状态
	private int state;
    //状态表示
	private String stateInfo;
	//秒杀成功对象
	private Success success;
		
	@Override
	public String toString() {
		return "SeckillExecution [seckillId=" + seckillId + ", state=" + state + ", stateInfo=" + stateInfo
				+ ", success=" + success + "]";
	}

	//成功
	public SeckillExecution(long seckillId, SeckillStatEnum statEnum, Success success) {
		super();
		this.seckillId = seckillId;
		this.state = statEnum.getState();
		this.stateInfo = statEnum.getStateInfo();
		this.success = success;
	}
	
	//失败
	public SeckillExecution(long seckillId, SeckillStatEnum statEnum) {
		super();
		this.seckillId = seckillId;
		this.state = statEnum.getState();
		this.stateInfo = statEnum.getStateInfo();
	}


	public long getSeckillId() {
		return seckillId;
	}
	public void setSeckillId(long seckillId) {
		this.seckillId = seckillId;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getStateInfo() {
		return stateInfo;
	}
	public void setStateInfo(String stateInfo) {
		this.stateInfo = stateInfo;
	}
	public Success getSuccess() {
		return success;
	}
	public void setSuccess(Success success) {
		this.success = success;
	}
	
	
}
